package com.lzhsite.technology.designPattern.decorate.PrizeDemo;

import java.util.Date;

public class GroupPrizeDecorator extends Decorator
{
    protected GroupPrizeDecorator(Component component)
    {
        super(component);
    }

    @Override
    public double calculatePrize(String user, Date begin, Date end)
    {
        double money = super.calculatePrize(user, begin, end);
        double group = 0.0;
        for (double d : TempDB.mapMonthlySaleMoney.values())
        {
            group += d;
        }
        double prize = group * 0.01;
        System.out.println(user + " 当月团队业务奖金" + prize);
        return money + prize;
    }
}
